/** This program will calculate are of a circle & a squire using constructor
 *  All the class are included in com.examples package 
 */
package simple.example;

/**
 * This is the class which will contain methods to calculate area
 *
 */
public class CalculateAreaCon
{
	private float perimeter;
	private float Area = 0.0f;
	CalculateAreaCon(float perimeter1, int SquareOrCircle)
	{
		perimeter = perimeter1;
		if (SquareOrCircle == 0 )
			CalculateSquareArea();
		else	
			CalculateCircleArea();
	}
	
	// TODO Auto-generated constructor stub
	// Calculate the area of a squire
	void CalculateSquareArea()
	{
		float length 	= perimeter/4.0f;
		Area			= length * length;
		System.out.println("Area of the squire is " + Area);
	}
	// Calculate the area of a squire
	void CalculateCircleArea()
	{
		float redious 	= perimeter/3.14f;
		Area			= (redious * redious *3.14f)/4.0f;
		System.out.println("Area of the circle is " + Area);
	}
}

class AreacalculationCon
{
	public static void main(String args[])
	{
		CalculateAreaCon object1 = new CalculateAreaCon(32.0f,0);
		CalculateAreaCon object2 = new CalculateAreaCon(78.5f,1);
	}
}